import { ref} from 'vue';
import * as $axios from '../api/index'
import { useDemoStore } from '../pinia/index'
const store = useDemoStore()

const useBrand = (num) => {
    const newBrand = ref([])
    const data = {
        token: store.token,
        keywords: num 
    }
    $axios.$product_brand(data).then(res => {
        newBrand.value = res.data.map(item => {
            return {
                'label': item.brand_name,
                'id': item.brand_id
            }
        })
    })
    return {
        newBrand
    }
}
export default useBrand
